
interface IShape{
    public int age=2;
    public String name="1";
    //默认是这个
    public static final String sex="1";

    //方法默认这个
    public abstract void draw();

    //也可以
    default public  void func()
    {
        System.out.println("66666666");
    }

    public static void staticfunc()
    {
        System.out.println("staticfunc");
    }
}

class Rect implements IShape
{

    @Override
    public void draw() {
        System.out.println("矩形！");
    }
}
class Flower implements IShape
{

    @Override
    public void draw() {
        System.out.println("花！");
    }
}
public class Test3 {
    public static  void func(IShape iShape)
    {
        iShape.draw();
    }
    public static void main(String[] args) {

        //接口不能被实例化

        IShape iShape=new Rect();
        IShape iShape1=new Flower();
//        iShape.draw();
//        iShape1.draw();

        IShape.staticfunc();
        func(iShape);
        func(iShape1);
        System.out.println("=========");
        func(new Rect());
        func(new Flower());

    }
}
